package com.zf.zfed.audit.tools

import com.zf.zfed.audit.base.fragment.TaskStatusChecker


/**
 * @Author: dw
 * @Date: 2024/12/10 19:49
 * @Description:
 */
object ViewManager {
    private val views = mutableListOf<TaskStatusChecker>()

    fun registerView(view: TaskStatusChecker) {
        views.add(view)
    }

    fun unregisterView(view: TaskStatusChecker) {
        views.remove(view)
    }

    fun areTaskRunningInDialogs(): Boolean {
        for (view in views) {
            if (view.isTaskRunning()) {
                return true
            }
        }
        return false
    }

    fun clear() {
        views.clear()
    }
}